package com.gof.example.memo;

/**
 * Created with IntelliJ IDEA.
 * Created by zhiyuan on 2018/5/11 10:44.
 * haiming.fei@tongdun.cn
 */
public class App {

    public static void main(String[] args) {
        MemoCreator memoCreator = new MemoCreator();
        Game game = new Game();

        game.setEnvironment("abc");
        memoCreator.setMemoInfo(game.save());
        System.out.println(game);

        game.setEnvironment("abc1");
        memoCreator.setMemoInfo(game.save());
        System.out.println(game);

        game.setEnvironment("abc2");
        System.out.println(game);

        game.restore(memoCreator.getMemoInfo());
        System.out.println(game);
    }
}
